// 接口统一管理

import service from '@/api/ajax'

export const login = params => service.get('/login')

export const postLogin = params => service.post('/login', params)

export const index = params => service.get('/home')

export const getConfig = params => service.get('/configs')

// export const getCategoryList = params => get('product/getBaseCategoryList', params);

// // banner数据
// export const getBanner = params => mock_get('banner', params)

// // 首页获取floor数据
// export const getFloor = params => mock_get('floor', params)

// // 搜索也数据
// // export const getSearch = params => service.post('/list', {})

// export const getSearch = params => service.post('/list', params)

// export const reqGoosInfo = skuid => service.get('/item/' + skuid)

// // 加入购物车或者更新购物车某个产品的数量
// export const addToCart = (skuId, skuNum) => service.post('/cart/addToCart/' + skuId + '/' + skuNum)

// // 购物车列表
// export const cartList = params => service.get('/cart/cartList')

// // 8. 切换商品选中状态 /api/cart/checkCart/{skuID}/{isChecked} get isChecked: 0/ 1
// export const reqCartItemCheckedStatus = (skuId, isChecked) => service.get(`/cart/checkCart/${skuId}/${isChecked}`)

// // 9. 删除购物车商品 /api/cart/deleteCart/{skuId} delete
// export const reqCartItemDelete = skuId => service.delete(`/cart/deleteCart/${skuId}`)

// // 获取验证码 /api/user/passport/sendCode/{phone} get
// export const reqGetCode = phone => service.get(`/user/passport/sendCode/${phone}`)
// // 注册 /api/user/passport/register， post
// export const reqRegister = (phone, password, code) => service.post('/user/passport/register', {phone, password, code})

// // 登录 /api/user/passport/login post
// export const reqLogin = (phone, password) => service.post('/user/passport/login', {phone, password})
// // 退出 /api/user/passport/logout get
// export const reqLogout = () => service.get('/user/passport/logout')

// // 获取登录用户信息
// export const reqGetUserInfo = () => service.get('/user/passport/auth/getUserInfo')

// // 获取用户地址
// export const reqGetUserAddress = () => service.get('/user/userAddress/auth/findUserAddressList')

// // 获取订单交易页面信息
// export const reqTradeInfo = () => service.get('/order/auth/trade');

// // 提交订单 /order/auth/submitOrder?tradeNo={tradeNo}
// export const reqSubmitTrade = (params) => service.post(`/order/auth/submitOrder?tradeNo=${params.tradeNo}`, params)

// export const reqGetOrderInfo = (orderId) => service.get(`/payment/weixin/createNative/${orderId}`)

// // 查询订单支付状态 /api/payment/weixin/queryPayStatus/{orderId}
// export const reqGetPayStatus = (orderId) => service.get(`/payment/weixin/queryPayStatus/${orderId}`)

// // 获取我的订单
// export const reqGetMyOrder = (page, limit) => service.get(`/order/auth/${page}/${limit}`)